﻿@using Orchard.Indexing
@using Orchard.Utility.Extensions
@model Orchard.Indexing.Settings.TypeIndexing
@{
    var indexProvider = WorkContext.Resolve<IIndexManager>().GetSearchIndexProvider();
    
}

@if (indexProvider != null) {
    var i = 0;
    foreach (var index in indexProvider.List()) {
        <fieldset>
            <legend>@T("{0} index", @index)</legend>
            <select size="0" name="@Html.FieldNameFor(m => m.List)">
                <option value="" selected="@(!Model.List.Contains(index + ":latest") && !Model.List.Contains(index))">@T("Not indexed")</option>
                <option value="@index" selected="@(Model.List.Contains(index))">@T("Published version")</option>
                <option value="@(index):latest" selected="@(Model.List.Contains(index + ":latest"))">@T("Latest version")</option>
            </select>
        </fieldset>
        i++;
    }
}